Opt("SendKeyDelay", 20) ;70
Opt("PixelCoordMode", 0)
Opt("MouseCoordMode", 0)

HotKeySet("`","exitz")
HotKeySet("^`", "a0")
HotKeySet("^1", "a1")

;;;; Body of program would go here ;;;;
While 1
    Sleep(100)
WEnd
;;;;;;;;
Func exitz()
	While 1

	WEnd
EndFunc

Func a0()
	Sleep(500)
	WinActivate("SIMPLY")
EndFunc

Func eventChange()
	$cord = PixelSearch(300,200,300,200,0x404040)
	If @error Then
		MsgBox(0,"error","error")
	EndIf
EndFunc

Func deadlineChange()
	$cord = PixelSearch(300,450,300,450,0x404040)
	If @error Then
		MsgBox(0,"error","error")
	EndIf
EndFunc

Func taskChange()
	$cord = PixelSearch(300,600,300,600,0x404040)
	If @error Then
		MsgBox(0,"error","error")
	EndIf
EndFunc

Func a1()
	$a = 500
	Sleep(500)
	WinActivate("SIMPLY")
	Sleep($a)
    Send("add nus open house: with start and end date, on 10/04/14 at 1400,to 22/05/14 at 1600")
	Sleep($a)
	Send("{ENTER 2}")
	Sleep($a)
	Call("eventChange")

	Send("add project meeting: single date, on 23/04/14")
	Sleep($a)
	Send("{ENTER 2}")
	Sleep($a)
	Call("eventChange")

	Send("add essay, by 20/04/14")
	Sleep($a)
	Send("{ENTER}")
	Sleep($a)
	Call("deadlineChange")

	Send("add wash clothes")
	Sleep($a)
	Send("{ENTER 2}")
	Sleep($a)
	Call("taskChange")

	Send("display")
	Sleep($a)
	Send("{ENTER}")
	Sleep($a)

	Send("display 1")
	Sleep($a)
	Send("{ENTER}")
	Sleep($a)

	Send("display event")
	Sleep($a)
	Send("{ENTER}")
	Sleep($a)

	Send("display incomplete")
	Sleep($a)
	Send("{ENTER}")
	Sleep($a)

	Send("search ect")
	Sleep($a)
	Send("{ENTER}")
	Sleep($a)

	Send("search date 21/04/14")
	Sleep($a)
	Send("{ENTER}")
	Sleep($a)

	Send("update wash clothes, name laundry")
	Sleep($a)
	Send("{ENTER}")
	Sleep($a)
	Call("taskChange")

	Send("{F2}update 2 startdate 19/04/14")
	Sleep($a)
	Send("{ENTER}")
	Sleep($a)
	Call("eventChange")

	Send("search essay")
	Sleep($a/2)
	Send("{ENTER}")
	Sleep($a/2)

	Send("update date 12/04/14")
	Sleep($a)
	Send("{ENTER}")
	Sleep($a)
	Call("deadlineChange")

	Send("mark essay")
	Sleep($a)
	Send("{ENTER}")
	Sleep($a)
	Call("deadlineChange")

	Send("mark")
	Sleep($a)
	Send("{ENTER}")
	Sleep($a)
	Call("deadlineChange")

	Send("{F2}mark 2")
	Sleep($a)
	Send("{ENTER}")
	Sleep($a)
	Call("eventChange")

	Send("delete project meeting")
	Sleep($a)
	Send("{ENTER 2}")
	Sleep($a)
	Call("eventChange")

	Send("{F2}delete 3")
	Sleep($a)
	Send("{ENTER}")
	Sleep($a)
	Call("taskChange")

	Send("search nus ")
	Sleep($a)
	Send("{ENTER 2}")
	Sleep($a)

	Send("delete")
	Sleep($a)
	Send("{ENTER}")
	Sleep($a)
	Call("eventChange")

	Send("undo")
	Sleep($a)
	Send("{ENTER}")
	Sleep($a)
	Call("eventChange")

	Send("redo")
	Sleep($a)
	Send("{ENTER}")
	Call("eventChange")
EndFunc